Skip to content

fix(backups): openclaw-backup dead links, Turso dump retries, per-db Turso retention - #11341

Merged
dezren39 merged 1 commit into
mainfrom
fix/backup-dead-links-turso-retention
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/backup-dead-links-turso-retention

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Before: the laptop's OpenClaw backup has failed verification every night since Nov 15, so its last offsite copy is from Nov 14. The nightly cold-store run fails whenever a Turso dump is cut off mid-download (4 of 42 databases on Nov 17). Its cleanup step then keeps only one Turso export per day across all databases: on Nov 17 it moved 37 of that night's 38 fresh Turso exports to the Drive trash.

After: the OpenClaw backup verifies even when its state dir holds links into the cleaned tmp/ tree. Turso dumps get spaced retries and a second pass at the end of the run. Turso cleanup keeps 30 daily / 12 weekly / 12 monthly exports for each database instead of for the whole folder.

How

  • nixos/home/openclaw-backup.sh: ~/.openclaw/acpx/vendor/... holds 36 absolute symlinks into ~/.openclaw/tmp/plugin-captures/<id>/, which has since been cleaned out. The manifest step opened one (FileNotFoundError), had no failure check, and the archive was built without manifest.json, which then failed the "VERIFY FAILED" check. The manifest now records symlinks by target ({"path", "symlink"}), and the verifier checks them with readlink. The manifest step and archive creation now fail immediately. New test scenario dangling-link reproduces the production failure against the old script and passes on the new one.
  • pkgs/cold-store-reaper/scripts/export-turso.sh: /dump now uses --retry 3 --retry-delay 30 (TURSO_DUMP_RETRY_DELAY_SECONDS, positive integer). Databases that still fail get one more pass after TURSO_DUMP_RETRY_PASS_DELAY_SECONDS (default 60). The exit status and the "N of M FAILED" line count only what failed both passes.
  • pkgs/cold-store-reaper/cold_store.py: new PER_SOURCE_RETENTION_DBS = {"turso"}. For those families, prune_backups groups files by the name after the stamp (turso-<stamp>-<database>.db.gz) and runs _retention_plan per group. supabase and d1 are unchanged.

Not in this PR (each needs Drew's yes)

  • Restoring the 37 Turso exports trashed on Nov 17 (they're in the Drive trash).
  • Rerunning openclaw-backup and cold-store-nightly once this is deployed.

Tests

  • bash nixos/home/openclaw-backup.test.sh: all passed (new dangling-link scenario included).
  • python3 -m unittest discover -s pkgs/cold-store-reaper/tests: OK (new per-database retention and second-pass tests included).

Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…Turso retention

openclaw-backup: the state dir holds absolute links into the excluded
tmp/ tree (acpx plugin vendor dirs). Once tmp/ was cleaned they
dangled, the manifest step opened one and crashed, the archive was
built without manifest.json, and verification failed every night from
2026-11-15. The manifest now records symlinks by target and the
verifier checks them as links; a manifest or archive-creation failure
now fails the run on the spot.

export-turso: on 2026-11-17 the server cut the /dump stream (curl 18)
on 4 of 42 databases, twice each. Dumps now get 3 retries 30 s apart
(TURSO_DUMP_RETRY_DELAY_SECONDS) and databases that still fail get a
second pass at the end of the run after a pause
(TURSO_DUMP_RETRY_PASS_DELAY_SECONDS, default 60).

cold-store prune-backups: the turso folder holds one export per
database per night, but retention read it as one series and kept only
the newest file per day, so it trashed 37 of the 38 fresh exports on
2026-11-17. Retention for turso now runs per source database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73fddbd9-377e-4912-9d4a-c2b522fbdfe6
Commits

Reviewing files that changed from the base of the PR and between 08e392a and e94d5ba.

Files selected for processing: 6

  • nixos/home/openclaw-backup.sh
  • nixos/home/openclaw-backup.test.sh
  • pkgs/cold-store-reaper/cold_store.py
  • pkgs/cold-store-reaper/scripts/export-turso.sh
  • pkgs/cold-store-reaper/tests/test_cold_store.py
  • pkgs/cold-store-reaper/tests/test_export_turso.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 marked this pull request as ready for review November 17, 2026 21:01
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 21:01
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T21:01:49.743418Z
We couldn’t complete this review. Comment @codex review to try again.
e94d5ba Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 3b60c21 into main Nov 17, 2026
@dezren39
dezren39 deleted the fix/backup-dead-links-turso-retention branch November 17, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants